<template>
  <van-tabs v-model:active="active">
    <van-tab :title="item.text" v-for="item in navlist" :key="item.id" :to="item.path"></van-tab>
  </van-tabs>
</template>
<script setup lang="ts">
import { getZhaiWu } from "@/api/dance";
import { useDanceStore } from "@/stores/dance";
import type { INavItem } from "../type";
import { getchannel } from "@/api/mock-home";
// active 表示当前选中标签的下标为 0
import { ref, onMounted } from "vue";
const active = ref(0);
const navlist = ref<INavItem[]>([]);
onMounted(async () => {
  try {
    let channerres = await getchannel();
    navlist.value = channerres.data.result;
  } catch (error) {
    console.log(error);
  }
});
</script>

<style scoped></style>
